home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / lib / partman / check.d / 12system_partitions_formatted < prev   
Encoding:
Text File  |  2009-04-19  |  1.2 KB  |  47 lines

  1. #! /bin/sh
  2. # Check that all system partitions are formatted.
  3.  
  4. . /lib/partman/lib/base.sh
  5.  
  6. for dev in $DEVICES/*; do
  7.     [ -d "$dev" ] || continue
  8.     cd $dev
  9.     partitions=
  10.     open_dialog PARTITIONS
  11.     while { read_line num id size type fs path name; [ "$id" ]; }; do
  12.     [ "$fs" != free ] || continue
  13.     partitions="$partitions $id,$path"
  14.     done
  15.     close_dialog
  16.  
  17.     for part in $partitions; do
  18.     id="${part%%,*}"
  19.     path="${part#*,}"
  20.     [ -f "$id/method" ] || continue
  21.     [ ! -f "$id/format" ] || continue
  22.     [ ! -f "$id/formatted" ] || continue
  23.     [ -f "$id/acting_filesystem" ] || continue
  24.     [ -f "$id/mountpoint" ] || continue
  25.     mountpoint="$(cat "$id/mountpoint")"
  26.     case $mountpoint in
  27.         /usr/local|/usr/local/*|/var/local|/var/local/*)
  28.         ;;
  29.         /|/boot|/boot/*|/usr|/usr/*|/var|/var/*)
  30.         db_reset ubiquity/partman-system-unformatted
  31.         db_subst ubiquity/partman-system-unformatted PARTITION "$path"
  32.         db_subst ubiquity/partman-system-unformatted MOUNTPOINT "$mountpoint"
  33.         db_input high ubiquity/partman-system-unformatted || true
  34.         db_go || true
  35.         db_get ubiquity/partman-system-unformatted
  36.         if [ "$RET" = true ]; then
  37.             exit 1
  38.         else
  39.             exit 0
  40.         fi
  41.         ;;
  42.     esac
  43.     done
  44. done
  45.  
  46. exit 0
  47.